Adding a Workflow Library to User Interface Applications |
|
Before you begin this task:
You must have the process developer role in the Process Platform Business Process Engine application package to add a workflow library to a User Interface (UI) application.
Application services can be of different types, such as XForms, or other Web Page URL-based UI applications such as HTML, JSP, and so on. An application service can be 'workflow-enabled' by adding a workflow library to it. For an XForm, the wrappers for the corresponding application handle the workflow. For a UI application, the workflow library has to be added by an application developer.
- Open the <UI page> to which you are adding the workflow library in a text editor. For example, consider an HTML application such as clickappservice.htm.
- Provide the HTML element <div> under the body tag.
- Provide
<div id='workflowEnabling' style='display:none'></div>
within this tag. The <div> tag will not be displayed as the workflow library does not have a user interface. - Add
application.addLibrary('/cordys/cas/vcm/library/workflow.htm', workflowEnabling);
to the <div> tag to add the workflow library during startup or initialization of the page. The workflow library is added to the <div> tag. - Register the function
(workflowEnabling.setPostInitializeFunction(postInitialize);
. This function is called when initialization succeeds. The function is registered. - Add
workflowEnabling.initializeWorkflow();
to call theinitializeWorkflow()
function to initialize workflow synchronization (for example:retrieving task details). ThepostInitialize
function must take the data from the APIs found in the /cordys/cas/vcm/library and render the data in the UI applications. For more information on the library functions, refer to Workflow library. - Add
application.removeLibrary('/cordys/cas/vcm/library/workflow.htm', workflowEnabling);
to remove the workflow library from the element to which it was added when the page is closed or unloaded. The workflow library is removed.
The application service is 'workflow enabled'.